using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using QuanLySim.DTO;
using QuanLySim.DAO;

namespace QuanLySim.BLO
{
    class clsQuanLyBLO
    {
        #region "variable"
        private clsQuanLyDTO m_QuanLyDto;
        private clsQuanLyDAO m_QuanLyDao;
        private string m_Erorr;
        #endregion

        #region "property"
        public string ERORR
        {
            get { return m_Erorr; }
            set { m_Erorr = value; }
        }

        internal clsQuanLyDTO QUANLYDTO
        {
            get { return m_QuanLyDto; }
            set { m_QuanLyDto = value; }
        }
        #endregion

        #region "method"
        public clsQuanLyBLO()
        {
            m_QuanLyDto = new clsQuanLyDTO();
            m_QuanLyDao = new clsQuanLyDAO();
            m_Erorr = "";
        }
        public bool Insert()
        {
            return m_QuanLyDao.Insert(m_QuanLyDto);
        }

        public bool Delete()
        {
            return m_QuanLyDao.Delete(m_QuanLyDto);
        }

        public bool Update()
        {
            return m_QuanLyDao.Update(m_QuanLyDto);
        }

        public DataTable QuanLy()
        {
            m_QuanLyDao = new clsQuanLyDAO();
            m_Erorr = m_QuanLyDao.ERORR;
            return m_QuanLyDao.QuanLy();
        }
        #endregion
    }
}
